from django.contrib import admin

from .models import User


# Register your models here.
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
    list_display = ('username', 'is_active', 'last_login', 'date_joined')

    fieldsets = (
        ('基本内容', {
            'description': '用户基本信息',
            'fields': (
                'username',
                'first_name',
                'last_name',
                'password',
                'sex',
            ),
        }),
        ('权限内容', {
            'description': '用户权限信息',
            'fields': (
                'groups',
                'user_permissions',
                'is_staff',
                'is_superuser',
            ),
        }),
        ('活跃内容', {
            'description': '用户活跃信息',
            'fields': (
                'is_active',
                'last_login',
                'date_joined',
            ),
        }),
        ('可选内容', {
            'description': '用户可选内容',
            'classes': ('collapse', ),
            'fields': (
                'image',
                'email',
                'phone',
                'location',
                'profession',
                'school',
                'company',
                'question',
                'answer',
            ),
        })
    )
